package com.qili.controller;


import com.alibaba.fastjson.JSON;
import com.qili.entity.supplier.dto.OaReDTO;
import com.qili.util.DateUtil;
import com.qili.util.HttpUtil;
import com.qili.util.Md5Util;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author zhaoyongke
 * @date 2021/4/17
 * @description
 */
public class Test {

    public static void main(String[] args)  throws Exception {
        String  key="WeaverOA";
        String contentType = "application/json; charset=UTF-8";
        String params = "";
        Date  date=new  Date();
        long time = date.getTime();
        String sign1= Md5Util.getBit32(time+key);
        String sign2= Md5Util.getBit32(sign1);
        String sign3= Md5Util.getBit32(sign2);
        System.out.println(time);
        String generalUrl = "http://oa.sdzz.cn/weaverjn/api/GetHtInfo.jsp?timestamp="+time+"&sign="+sign3;
        try {
            String  result=HttpUtil.getGeneralUrl(generalUrl, contentType, params, "UTF-8");
            OaReDTO oaReDTO = JSON.parseObject(result, OaReDTO.class);
            System.out.println(1111);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }



}
